jQuery(function(){
	var $ = jQuery;
	
	if($.browser.msie) {
		$("#topLink-bookmark").show().click(function() {
			this.blur();
			window.external.AddFavorite(location.href, document.title);
			return false;
		});
	}
	
	var urlstart = window.location.protocol+'//'+window.location.hostname;
	$(".mainMenu>li").each(function(){
		var href = $("a", this).attr("href");
		if(href.charAt(0) != "/") {
			 if(href.indexOf(urlstart) == -1) return;
			 href = href.substr(urlstart.length);
		}
		if(href != "/" && window.location.pathname.indexOf(href) == 0) $(this).addClass("selected");
	});
	
	$("img.ill").each(function() {
		$(this).css("background-image", "url("+this.src+")");
		this.src = "/css/0.gif";
	});
	
	$("#extDossierLink a").click(function() {
		this.blur();
		$("#extDossierLink").hide();
		$("#extDossier").show();
		return false;
	});

	$(".flash-object").each(function() {
		$(this).flash({
			src:	$(this).attr("movie"),
			width:	$(this).width(),
			height:	$(this).height()
		});
	});

});

// на всякий
var ya_escape = encodeURIComponent;