/** 
 *	Library Events Manager
 *
 *	@author Andrea Gatti Andrea (www.climbercat.altervista.org)
 *	@version 0.1
 *
 *	Requirements:
 */

//------------------------------------------------------------------------------

// onLoad

	window.addEvent('load', function(){
		/* Show pretty Tips */
		var myTips = new Tips($$('.tips'), {
			initialize:function(){
				this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 250, wait: false}).set(0);
			},
			onShow: function(toolTip) {
				this.fx.start(1);
			},
			onHide: function(toolTip) {
				this.fx.start(0);
			}
		});
		
		/* Use SmoothScroll */
		new SmoothScroll({duration: 1000, transition: Fx.Transitions.Cubic.easeInOut});
	});
	
	window.addEvent('domready', function(){
		gallery_on_header()
	});

//------------------------------------------------------------------------------

function rnd(n){
	return Math.round(n*Math.random());
}

// Show the search panel
	function funShowSearchBox() {
		funFadeOut("search-but");		// Utility.js
		funFadeIn("search-panel");	// Utility.js
		return;
	}

	function funHideSearchBox() {
		funFadeIn("search-but");		// Utility.js
		funFadeOut("search-panel");	// Utility.js
		return;
	}

// Change Post Language

	function funShowEngPost(postNumber) {
		funFadeOut("post-ita-"+postNumber);
		funFadeIn("post-eng-"+postNumber);
		return;
	}
	
	function funShowItaPost(postNumber) {
		funFadeOut("post-eng-"+postNumber);
		funFadeIn("post-ita-"+postNumber);
		return;
	}
	

