$(document).ready(function() {

	var subLiSize = $(".curr_menu .left_submenu li").size();
	if(subLiSize == 1) {
		$(".curr_menu .left_submenu li:eq(0)").css('position','relative').css('top','30px');
	}
	if(subLiSize == 2) {
		$(".curr_menu .left_submenu li:eq(0)").css('position','relative').css('top','15px');
		$(".curr_menu .left_submenu li:eq(1)").css('position','relative').css('top','20px');
	} 
	
	var siteUrl = window.location.hostname;
	var sitePath = window.location.href;
	var siteProtocol = window.location.protocol;
	var aHref = sitePath.replace(siteUrl,'');
	aHref = aHref.replace(siteProtocol,'');
	aHref = aHref.replace('//','');
	aHref1 = aHref.replace('#','');
	aHref = aHref1.replace('?lang=en','');
	if(aHref1 != aHref) {
		$('a').each(function(){
			var thisHref = $(this).attr('href');
			var thisHref1 = thisHref.replace('http','');
			if(thisHref == thisHref1) {
				$(this).attr('href',thisHref+'?lang=en');
			}
		});
		$('.switch-en').addClass('active');
	} else {
		$('.switch-ru').addClass('active');
	} 
	$('.switch-en').attr('href',aHref+'?lang=en');
	$('.switch-ru').attr('href',aHref);
	
	
	$(".answer .otv").each(function(){
		if($(this).text() == "") {
			$(this).parent().remove();
		}	
	});
	

	$("#restaurant option").each(function(){
		if($(this).val() == $("#restaurant").attr('title')) {
			$(this).attr('selected', 'selected');
		}
	});
	
});
