// Emulation target_blank
$(function(){
	    $("._blank a").click(function(){
	        window.open(this.href);
	        return false;
	    });
	});	
	
// right&left-column mo-box without top-margin
$(function(){
	    $(".center-col .mod-box:first-child, aside .mod-box:first-child, .left-col .mod-box:first-child").addClass("first-block");
		$(".center-col .mod-article:first-child, aside .mod-article:first-child, .left-col .mod-article:first-child").addClass("first-block");
		$(".center-col .week-survey:first-child, aside .week-survey:first-child, .left-col .week-survey:first-child").addClass("first-block");
		$(".center-col .mod-survey:first-child, aside .mod-survey:first-child, .left-col .mod-survey:first-child").addClass("first-block");
		$(".center-col .mod-news-sm:first-child, aside .mod-news-sm:first-child, .left-col .mod-news-sm:first-child").addClass("first-block");
		$("aside .udvertising-vert:first-child, .left-col .udvertising-vert:first-child").addClass("first-block");
		$("aside .mod-cards:first-child, .left-col .mod-cards:first-child").addClass("first-block");
		$("aside .mod-partners:first-child, .left-col .mod-partners:first-child").addClass("first-block");
		$(".center-col .mod-news:first-child").addClass("first-block");
		$("aside .mod-opros:first-child, .left-col .mod-opros:first-child").addClass("first-block");
		$(".mod-road span:first-child").addClass("first-block");
		$(".two-bar section:nth-child(2n + 1) article").addClass("odd");
	});

$(function(){
	    $("a.a_select-dropdown").click(function(){
	        $(".mod-city-sel-dropdown").toggle();
			return false;
	    });
	});

$(function(){
	    $("body").click(function(){
	        $(".mod-city-sel-dropdown:visible").hide();
			//return false;
	    });
	});
	
	// background li if a.selected-parent in vert-menu 
$(function(){
		$(".vert-menu li a.a-selected-parent").parent().has("a.a-selected-parent").addClass("vert-menu-li-bg");
	});

// last week-survey in left-right-col 
$(function(){
		$(".center-col .week-survey article:last, .left-col .week-survey article:last, aside .week-survey article:last").addClass("week-survey-end");
		$(".center-col .week-survey article:last .week-survey-text, .left-col .week-survey article:last .week-survey-text, aside .week-survey article:last .week-survey-text").addClass("week-survey-end");
	});

// three-bar  
$(function(){
		$(".three-bar :nth-child(3n + 1) article").addClass("art_nth_child3");
	});

// comments  
$(function(){
		$(".mod-comments .mod-comments-one:odd").addClass("comm-no-fon");
		$(".mod-comments .mod-comments-one:last").addClass("comm-last");
	});
	
	$(function(){
	$('.fancybox').fancybox();
});

function voteCheck(){
    g=document.getElementById('total').value;
    for (var i=1; i<=g; i++){
        if(document.getElementById('choice'+i).checked) return true;
    }
    alert('Выберите вариант!');
    return false;
}

function resize() {
	//var foot = document.getElementsByTagName('footer')[0];
	var foot = document.getElementById('footer');
	var footHeight = foot.offsetHeight;
	foot.style.height = footHeight+"px";
	document.getElementById('main').style.paddingBottom = footHeight+20+"px";
}	
window.onload = resize;
