$(document).ready(function(){

	$("body").addClass("js");

    overable($("#header .title a"));

	$("#keywords").cycle({
		timeout:       2000,  // milliseconds between slide transitions (0 to disable auto advance)
		speed:         1000,  // speed of the transition (any valid fx speed value)
		pause:         1     // true to enable "pause on hover"
	});
	

	replaceWord('#content h1', 'circé', '<span class="circe">circ<span>é</span></span>');
	replaceWord('#content h1', 'amnyos', '<span class="amnyos">amn<span>y</span>os</span>');
	replaceWord('#content', 'circé', '<span class="circe">circ<span>é</span></span>');
	//replaceWord('#content', 'amnyos', '<span class="amnyos">amn<span>y</span>os</span>');

	
	$(".print").click(function(){
		window.print();
		return false;
	});

});



function overable(elmt){
	var span = elmt.find("span:eq(0)");
	span.hide();
	elmt.hover(function(){
		span.fadeTo(250, 1);
	}, function(){
		span.fadeTo(250, 0);
	});
}

function replaceWord(arg, word, newWord) {
	$(arg).each(function () {
		var elmt = $(this);
		
		
		var html = elmt.html();

		var regEx = new RegExp("("+word+")", "g");

		html = html.replace(regEx, newWord);

		elmt.html(html);
		
	});

}
