/*
MSIE MENU

Project: Ulyssemag.com
Author:	DPh&Co
Version: 1.0
Last change: 07/18/08
*/

	var current_size = 2;
	var properties = new Array();
	properties[0] = {'size':'11px', 'leading':'16px'};
	properties[1] = {'size':'12px', 'leading':'18px'};
	properties[2] = {'size':'13px', 'leading':'20px'};
	properties[3] = {'size':'15px', 'leading':'23px'};
	properties[4] = {'size':'17px', 'leading':'27px'};
	$('#bigger').click(function() {
		if (current_size < properties.length - 1) {
			current_size++;
			$('#article_body,#article_body *:not(.copyright):not(.caption):not(.origin)').css({'font-size':properties[current_size].size, 'line-height':properties[current_size].leading});
			$('.asides dl dt,.asides dl dd').css({'font-size':properties[current_size].size, 'line-height':properties[current_size].leading});
		}
		return false;
	});
	$('#smaller').click(function() {
		if (current_size > 0) {
			current_size--;
			$('#article_body,#article_body *:not(.copyright):not(.caption):not(.origin)').css({'font-size':properties[current_size].size, 'line-height':properties[current_size].leading});
			$('.asides dl dt,.asides dl dd').css({'font-size':properties[current_size].size, 'line-height':properties[current_size].leading});
		}
		return false;
	});

$(document).ready(function() {
	if ($.browser.msie) {
		$('#main-nav').children('li').each(function(i, li) {
			$(li).mouseover(function(event) {
				$(this).addClass('over');
			}).mouseout(function() {
				$(this).removeClass('over');
			});
		});
	}
	$('#article_body h4').each(
		function(i) {
			if ($(this).parents('.heading').length == 0) {
				$(this).wrap("<div class='heading narrow'></div>");
			}
		});
	});

/*
TAB NAVIGATION

Project: Ulyssemag.com
Author:	DPh&Co
Version: 1.0
Last change: 07/18/08
*/

$(document).ready(function() {
	var activate = function(title) {
		$(title).addClass('active').siblings().removeClass('active');
		$(title).children('span').children('img').attr({src:$(title).children('span').children('img').attr('src').replace('_off_','_on_')});
		$(title).siblings().each(function () {
		  $(this).children('span').children('img').attr({src:$(this).children('span').children('img').attr('src').replace('_on_','_off_')});  
		});
		$(title).parent('ul').nextAll('.panel').css('display', 'none').eq(title.index).css('display', 'block');
	}
	
	$('.tabs').each(function(i, tab) {
		$('.titles li', tab).each(function(j, title) {
			title.index = j;
			if (title.index == 0) {
				activate(title);
			}
			$(title).click(function(event) {
				activate(this);
			});
		});
	});
});

/*
TREE

Project: Ulyssemag.com
Author:	DPh&Co
Version: 1.0
Last change: 08/07/08
*/

$(document).ready(function() {
	$('.folders li:has(ul)').each(function(i, folder) {
		$(folder).click(function(event) {
			$(this).toggleClass('open');
		});
	});
});

function imprimer()
{
 $('div.paginate').show();
$('div.numbering').hide();
 window.print();
setTimeout("printTimeout()",3000); 
}

function printTimeout(){
$('div.paginate').hide();
var page = 'div#page_'+$('span#current_page').html();
 $(page).show();
}
