  $(document).ready(function(){

	var nav  = $('#head ul');
    var path = window.location.pathname.split('/').slice(1,-1);
    function act(p) {
        nav.not(nav.find('li.active').parent())
            .find('li>a[@href="/'+p+'"]').parent().addClass('active');
    }
    if (path.length)
        for(; path.length; path.pop())
            act(path.join('/')+'/');
    else
        act('');
    $('#head > ul > li > a').not('.link:only-child').removeAttr('href').click(function(){
      $('#head > ul > li.active').removeClass('active');
      $('#head > ul > li > ul').css('display','none');
      $(this).parent().addClass('active');
      $(this).next().fadeIn("normal");
    }).hover(
		function() { $(this).addClass('hover') },
		function() { $(this).removeClass('hover') }
	);
	
	$('#content .images li:first-child').addClass('active');
	
	$('#content .images li:only-child').parents('ul').css('display','none');
	
	$('#content .images').galleria({
	  insert:'#main_img',
		history:false,
		onImage : function(image,caption) { image.css({display:'none'}).fadeIn('fast'); },
		onThumb : function(thumb) { thumb.css('display','none').fadeIn('slow'); }
	});

	var _attr = {
		size:30,
		leading:-1,
		linkColor:'#000000',
		hoverColor:'#ee00aa',
		activeColor:'#000000',
		uppercase:true,
		top:0,
		tolerance:999,
		width:450,
		selectable:true
	};

	//  ------------------------------------------
		fr.convert('h1','/media/swf/fr.swf',_attr);
		_attr.align='right';
		_attr.width=184;
		fr.convert('#logo','/media/swf/fr.swf',_attr);
});

